<template>
  <ex-config-provider v-bind="elementConfig">
    <router-view />
    <router-view v-slot="{ Component, route }" name="H5">
      <keep-alive :max="30">
        <component :is="Component" :key="route.fullPath" />
      </keep-alive>
    </router-view>
  </ex-config-provider>
</template>

<script setup lang="ts">
import { onMounted, reactive } from 'vue';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import { ExConfigProvider } from 'element-plus-extension';
import { useSetThemeColor } from '@/layout/components/theme-setting/hooks/useSetThemeColor';

const elementConfig = reactive({
  locale: zhCn,
  zIndex: 1000
});

const { initializeTheme } = useSetThemeColor();

onMounted(initializeTheme);
</script>
